package cn.zwx.search.model.es;

import cn.zwx.search.annotation.Document;
import cn.zwx.search.annotation.EsId;
import cn.zwx.search.annotation.Field;
import cn.zwx.search.common.enums.AnalyzerType;
import cn.zwx.search.common.enums.FieldType;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @description: 产品Es类
 * @projectName:search-example
 * @see:cn.zwx.search.model
 * @author:zhangwenxue
 * @createTime:2020/10/23 17:04
 * @version:1.0
 */
@Data
@Document(index = "t_product_info")
public class ESProduct {

    /**
     * @description 产品id
     **/
    @Field(type = FieldType.KEYWORD)
    @EsId
    private String productId;

    /**
     * @description skuId
     **/
    @Field(type = FieldType.KEYWORD)
    private String skuId;

    /**
     * @description skuName
     **/
    @Field(type = FieldType.TEXT,analyzer = {AnalyzerType.IK_MAX_WORD})
    private String skuName;

    /**
     * @description 产品名称
     **/
    @Field(type = FieldType.TEXT,analyzer ={AnalyzerType.IK_MAX_WORD,AnalyzerType.PIN_YIN_WORD})
    private String productName;


    /**
     * @description 类目id
     **/
    @Field(type = FieldType.KEYWORD)
    private Long catalogId;

    /**
     * @description 类目名称
     **/
    @Field(type = FieldType.TEXT,analyzer = {AnalyzerType.IK_MAX_WORD})
    private String catalogName;

    /**
     * @description 品牌编码
     **/
    @Field(type = FieldType.KEYWORD)
    private String brandCode;

    /**
     * @description 品牌名称
     **/
    @Field(type = FieldType.TEXT,analyzer = {AnalyzerType.IK_MAX_WORD})
    private String brandName;

    /**
     * @description 价格
     **/
    @Field(type = FieldType.DOUBLE)
    private BigDecimal price;


    /**
     * @description 创建时间
     **/
    @Field(type = FieldType.DATE)
    private String createTime;

    /**
     * @description 描述
     **/
    @Field(type = FieldType.TEXT,analyzer ={AnalyzerType.IK_MAX_WORD})
    private String desc;

    /**
     * @description 商品详情信
     * @author zhangwenxue
     * @createTime 2020/10/23 17:21
     **/
    @Field(type = FieldType.OBJECT)
    private ESProductDetailDTO repertoryDTO;

}
